package com.codechuan.demo.ui.my;


import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class MyViewModel extends ViewModel {

    private final MutableLiveData<String> myText;

    public MyViewModel() {
        myText = new MutableLiveData<>();
        myText.setValue("我的内容");
    }

    public LiveData<String> getText(String text) {
        myText.setValue(text);
        return myText;
    }
}
